package com.allo2o.common.convertor;

import com.allo2o.common.VO.PayableBankVO;
import com.allo2o.common.domain.PayableBankDO;
import org.springframework.beans.BeanUtils;

/**
 * Created by lubingbing on 16-5-21.
 *
 * @auth lubingbing
 */
public class PayableBankConvertor {

    /**
     * <ul>
     * convert dto to vo
     * </ul>
     *
     * @param dto
     *            PayableBankDO
     * @return PayableBankVO
     */
    public static PayableBankVO DO2VOConvertor(PayableBankDO dto) {
        PayableBankVO vo = new PayableBankVO();
        if (dto == null) {
            return null;
        }
        BeanUtils.copyProperties(dto, vo);
        return vo;
    }

    /**
     * <ul>
     * convert vo to dto
     * </ul>
     *
     * @param vo
     *            PayableBankVO
     * @return PayableBankDO
     */
    public static PayableBankDO VO2DOConvertor(PayableBankVO vo) {
        PayableBankDO dto = new PayableBankDO();
        if (vo == null) {
            return null;
        }
        BeanUtils.copyProperties(vo, dto);
        return dto;
    }
}
